{% extends "admin/base.html" %}

{% load i18n %}

{% block title %}{% trans "New Group" %}{% endblock %}

{% block content %}
    <div class="col-lg-12 col-md-12">
      <div class="text-left">
        <h3 class="px-3">{{ title }}</h3>
      </div>
    </div>
    <div class="col-lg-12 col-md-12">
        <div class="p-1 p-md-3">
          <!-- form error messages -->
            {% if form.errors %}
              <ul class='form-errors text-danger list-unstyled'>
                {% for field in form %}
                    {% for error in field.errors %}
                      <li><i class="fa fa-exclamation-triangle m-2"></i>{{ error|escape }}</li>
                    {% endfor %}
                {% endfor %}
                {% for error in form.non_field_errors %}
                    <li>{{ error|escape }}</li>
                {% endfor %}
              </ul>
            {% endif %}
            <!-- form error messages -->
            <form class="group" method="POST" action="{{ action_url }}">
              {% csrf_token %}
              {% for field in form %}
                <div class="form-group">
                    {{ field.errors }}
                    {{ field.label_tag }}
                    {{ field }}
                    {% if field.help_text %}
                      <small class="form-text text-muted">{{ field.help_text|safe }}</small>
                    {% endif %}
                </div>
              {% endfor %}
                <button class="button btn btn-success mt-3" type="submit">
                  <i class="fa fa-check"></i>
                  {% trans 'Save' %}
                </button>
            </form>
        </div>
    </div>
{% endblock %}